package com.aboverock.module.system.domain;

import com.aboverock.core.orm.domain.StringBaseEntity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.List;
import javax.validation.constraints.NotBlank;
import org.hibernate.validator.constraints.Length;

/**
 * <p>
 * 角色信息.
 * </p>
 *
 * @author Rock Wang
 * @since 2018-05-11
 */
@TableName("t_sys_role")
@ApiModel(value = "Role对象", description = "")
public class Role extends StringBaseEntity {

    @ApiModelProperty(value = "角色code")
    @NotBlank
    @Length(min = 1, max = 64)
    private String code;

    @ApiModelProperty(value = "角色名称")
    @NotBlank
    private String name;

    @ApiModelProperty(value = "备注")
    @Length(max = 255)
    private String remark;

    @ApiModelProperty(value = "0:可修改可删除，1：可修改不可删除，2，不可修改code且不可删除")
    private Integer limitOperation;

    @TableField(exist = false)
    private List<String> userIds;

    @TableField(exist = false)
    private List<String> resourceIds;

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Integer getLimitOperation() {
        return limitOperation;
    }

    public void setLimitOperation(Integer limitOperation) {
        this.limitOperation = limitOperation;
    }

    public List<String> getUserIds() {
        return userIds;
    }

    public void setUserIds(List<String> userIds) {
        this.userIds = userIds;
    }

    public List<String> getResourceIds() {
        return resourceIds;
    }

    public void setResourceIds(List<String> resourceIds) {
        this.resourceIds = resourceIds;
    }

    @Override
    public String toString() {
        return "Role{" +
        "code=" + code +
        ", name=" + name +
        ", remark=" + remark +
        ", limitOperation=" + limitOperation +
        "}";
    }

}
